#ifndef MYTCPSOCKET_H
#define MYTCPSOCKET_H

#include "protocol.h"
#include "reqhandler.h"

#include <QObject>
#include <QTcpSocket>

class MyTcpSocket : public QTcpSocket
{
    Q_OBJECT
public:
    MyTcpSocket();
    ~MyTcpSocket();
    // 发送消息
    void sendMsg(PDU* pdu);
    PDU* readPDU();
    PDU* handleReq(PDU* pdu);
    QString m_strLoginName;
    ReqHandler* rh;
public slots:
    // 接收消息
    void recvMsg();
    void clientOffline();

signals:
    void offline(MyTcpSocket* mysocket);
};

#endif // MYTCPSOCKET_H
